home *** CD-ROM | disk | FTP | other *** search
- Path: dispatch.news.demon.net!demon!uribe.demon.co.uk
- From: roger@uribe.demon.co.uk (Roger Uribe)
- Newsgroups: comp.lang.c++
- Subject: const FAR* for a DLL
- Date: Sun, 07 Apr 1996 10:32:44 GMT
- Message-ID: <828873144.24425@uribe.demon.co.uk>
- NNTP-Posting-Host: uribe.demon.co.uk
- X-NNTP-Posting-Host: uribe.demon.co.uk
- X-Newsreader: Forte Free Agent 1.0.82
-
- Below is an exctract from a DLL I am trying to write. The 2nd parameter
- for FillRect is defined in windows.h as const RECT FAR* Could somebody
- PLEASE tell me how to set it up - I've tried everything I can think of,
- plus a few suggestions from others with no success so far.
- e.g. &rect and other attempts to define a suitable pointer.
-
- #include <windows.h>
- //This is copied from windows.h
- //int WINAPI FillRect(HDC, const RECT FAR*, HBRUSH);
-
- int FAR PASCAL _export LibMain(HANDLE hInstance,WORD wDataSeg,
- WORD wHeapSize,LPSTR lpszCmdLine)
- {
- if(wHeapSize > 0)
- UnlockData(0);
- return(1);
- };
-
- int FAR PASCAL _export myShow(int dest)
- {
- int i;
- long colour;
- typedef struct
- { int left; int top; int right; int bottom;}
- Srect;
-
- Srect rect;
-
- colour = 0xFF00 ;
- i= FillRect( dest, rect, CreateSolidBrush (colour)); <--- here please
- return(i);
- }
-
- c:\...\drect.c(22) : error C2115: 'argument' : incompatible types
- c:\...\drect.c(22) : warning C4024: 'FillRect' : different type
- for formal and actual parameter 2
-
- Thanks Roger
- ------- the end
-
-
-